#!/usr/bin/php
<?php
mysql_connect("localhost","root","marduk");
mysql_select_db("infopark_com_ua");

/*
for($nid=12127;$nid<12198;$nid++)
  {
    // $sql="INSERT INTO taxonomy_index (tid,nid) VALUES (239,".$nid.")";
    $sql="INSERT INTO node_advert_dates (nid,public_date) VALUES (".$nid.",'".date("Y-m-d")."')";
    mysql_query($sql);
    print $sql."\n";
    }*/
$result=mysql_query("SELECT * FROM `node_advert_terms_taxonomy` WHERE old_cat_id IS NOT NULL");
while($r=mysql_fetch_assoc($result))
  {
    $sql1="UPDATE taxonomy_term_data SET old_cat_id='".mysql_escape_string($r['old_cat_id'])."' WHERE tid=".$r['tid'];
    print $sql1."\n";
    mysql_query($sql1);
  }
?>